# utils/synonym.py
# 简单同义词扩展工具（可扩展为调用第三方API）

SYNONYM_MAP = {
    "瑜伽": ["瑜伽", "拉伸", "柔韧"],
    "健康": ["健康", "养生", "保健"],
    "疾病": ["疾病", "病症", "病"],
    "训练": ["训练", "锻炼", "健身"],
    "课程": ["课程", "课", "训练营"],
    "视频": ["视频", "影片", "教学视频"],
    "文章": ["文章", "资讯", "内容"],
    "动态": ["动态", "帖子", "分享"],
    "yoga": ["yoga", "stretching", "flexibility"],
    "health": ["health", "wellness", "fitness"],
    "disease": ["disease", "illness", "sickness"],
    "training": ["training", "workout", "exercise"],
    "course": ["course", "class", "camp"],
    "video": ["video", "movie", "tutorial"],
    "article": ["article", "news", "content"],
    "post": ["post", "share", "topic"]
}

def expand_synonyms(text: str) -> list:
    """
    对输入文本进行同义词扩展，返回所有相关同义词
    """
    words = text.split()
    expanded = set()
    for word in words:
        if word in SYNONYM_MAP:
            expanded.update(SYNONYM_MAP[word])
        else:
            expanded.add(word)
    return list(expanded) 